import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;

import javax.swing.JOptionPane;


public class Principal {
	
	public static void main(String[] args) {
		
		ArrayList<Aluno> a = new ArrayList<Aluno>();
		a.add(new Aluno(5));
		a.add(new Aluno(20));
		a.add(new Aluno(8));
		a.add(new Aluno(0));
		a.add(new Aluno(18));
		a.add(new Aluno(2));
		
		Collections.sort(a);
		
		String t = "";
		for (Aluno d: a){
			t += d.getIdade()+"\n";
		}
		JOptionPane.showMessageDialog(null, t);
	}
}
